#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>

void Odd_even_arr_ajust(int* arr, int sz)
{
	int p = sz - 1;
	int s = 0;
	while (s < p)
	{
		if (arr[s] % 2 == 0&&arr[p] %2 != 0)
		{
			int tmp = arr[s];
			arr[s] = arr[p];
			arr[p] = tmp;
		}
		else
		{
			if (arr[s] % 2 == 0 && arr[p] % 2 == 0)
			{
				--p;
			}
			else
			{
				++s;
			}
		}
	}
}

void Print(int* arr, int sz)
{
	for (int i = 0; i < sz; ++i)
	{
		printf("%d ", arr[i]);
	}
	printf("\n");
}


int main()
{
	int arr[] = { 1,3,4,5,2,7,8,11,21,34 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	Odd_even_arr_ajust(arr, sz);
	Print(arr,sz);

	return 0;
}